package cn.mygweb.admin.modules.tools.service;

import java.util.List;

import cn.mygweb.admin.modules.tools.pojo.Email;
import cn.mygweb.admin.modules.tools.pojo.EmailServerConf;

/** 
* <p>Title: EmailService.java</p>
* <p>Description: 邮件发送业务层接口</p>
* @author gxb 
* @date 2019年7月13日 
* <p>Copyright: Copyright (c) 2019</p>
* <p>Company: www.mygweb.cn</p> 
*/
public interface EmailService {

	/**
	 * <p>Title: saveEmailConf</p>
	 * <p>Description: 保存邮箱的配置信息</p>
	 * @param emailServerConf
	 */
	void saveEmailConf(EmailServerConf emailServerConf);
	
	/**
	 * <p>Title: queryEmailConfList</p>
	 * <p>Description: 查询邮箱配置信息</p>
	 * @param 	邮箱配置信息实体类对象
	 * @return	邮箱配置信息集合
	 */
	List<EmailServerConf> queryEmailConfList(EmailServerConf emailServerConf);
	
	/**
	 * <p>Title: updateEmailConf</p>
	 * <p>Description: 修改邮箱配置信息</p>
	 * @param emailServerConf
	 */
	void updateEmailConf(EmailServerConf emailServerConf);

	/**
	 * <p>Title: sendHtmlMail</p>
	 * <p>Description: 发送html邮件或普通的文本邮件</p>
	 * @param emailServerConf	邮件配置信息实体类
	 * @param to		接收者
	 * @param subject	主题
	 * @param content	内容
	 * @throws Exception
	 */
	void sendHtmlMail(EmailServerConf emailServerConf, String to, String subject, String content) throws Exception;
	
	/**
	 * <p>Title: sendInlineResourceMail</p>
	 * <p>Description: 发送带图片的邮件</p>
	 * @param emailServerConf	邮件配置信息实体类
	 * @param to		收件邮箱
	 * @param subject	主题
	 * @param content	内容
	 * @param rscPath	资源路径
	 * @param rscId		资源id
	 */
	void sendInlineResourceMail(EmailServerConf emailServerConf, String to, String subject, String content, String rscPath, String rscId) throws Exception;

	/**
	 * <p>Title: sendAttachmentsMail</p>
	 * <p>Description: 发送带附件的邮件</p>
	 * @param emailServerConf	邮件配置信息实体类
	 * @param to		发件人名称
	 * @param subject	主题
	 * @param content	内容
	 * @param filePath	附件路径
	 * @throws Exception
	 */
	void sendAttachmentsMail(EmailServerConf emailServerConf, String to, String subject, String content, String filePath) throws Exception;
	
	/**
	 * <p>Title: sendMail</p>
	 * <p>Description: 通用的发送邮件方法</p>
	 * @param emailServerConf
	 * @param to
	 * @param subject
	 * @param content
	 * @param filePath
	 * @throws Exception
	 */
	void sendMail(EmailServerConf emailServerConf, String to, String subject, String content, String filePath) throws Exception;
	
	/**
	 * <p>Title: queryEmailListPaged</p>
	 * <p>Description: 分页查询邮件信息列表</p>
	 * @param email		邮件对象
	 * @param pageNum	页数，第几页		
	 * @param pageSize	每页显示条数
	 * @return
	 */
	List<Email> queryEmailListPaged(Email email, Integer pageNum, Integer pageSize);
	
	/**
	 * <p>Title: saveEmail</p>
	 * <p>Description: 保存发送邮件信息</p>
	 * @param email
	 */
	void saveEmail(Email email);

	/**
	 * <p>Title: selectCount</p>
	 * <p>Description: 查询邮件条数</p>
	 * @param email
	 * @return
	 */
	Integer selectCount(Email email);
}
